<!doctype html>
<html>

<head>
  <!-- css文件 -->
  {include file="public/title" /}
</head>
<body data-type="generalComponents">
  <!-- 头部 -->
  {include file="public/header" /}
  <div class="tpl-page-container tpl-page-header-fixed">
    <!-- 左侧导航 -->
    {include file="public/leftNav" /}
    <div class="tpl-content-wrapper">
      <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">管理员管理</a></li>
        <li class="am-active">管理员列表</li>
      </ol>
      <div class="tpl-portlet-components">
        <div class="tpl-block">
          <div class="am-g">
            <div class="am-u-sm-12 am-u-md-6">
              <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                  <button type="button" class="am-btn am-btn-default am-btn-success"><a href="{:url('admin/add')}" style="color:#fff;"><span class="am-icon-plus"></span>
                    新增</a></button>
                </div>
              </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
              <div class="am-form-group">
              </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
              <div class="am-input-group am-input-group-sm">
              </div>
            </div>
          </div>
          <div class="am-g">
            <div class="am-u-sm-12">
              <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                  <tr>
                    <th class="table-title" >管理员</th>
                    <th class="table-title" >电话</th>
                    <th class="table-title" >创建时间</th>
                    <th class="table-set" >操作</th>
                  </tr>
                </thead>
                <tbody>
                  {volist name="admin" id="value"}
                  <tr>
                    <td><a href="#">{$value.user}</a></td>
                    <td>{$value.tel}</td>
                    <td>{$value.create_time|date="Y-m-d H:i:s",###}</td>
                    <td>
                      <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a href="{:url('edit',['id'=>$value.id])}"><button class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span>
                            编辑</button></a>
                            <a href="javascript:;"><button onclick="del(this,{$value.id})" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span
                              class="am-icon-trash-o"></span>
                            删除</button></a>
                        </div>
                      </div>
                    </td>
                  </tr>
                  {/volist}
                </tbody>
              </table>
              <div class="am-cf">
                <div class="am-fr">
                  <!-- 分页 -->
                  {$admin->render()}
                </div>
              </div>
              <hr>
            </div>
          </div>
        </div>
        <div class="tpl-alert"></div>
      </div>
    </div>
  </div>
  <!-- js -->
  {include file="public/foot" /}
  <script>
    function del(obj,id){
      $.post("{:url('admin/ajax_del')}",{id:id},function(data){
        if(data.code==1){
          layer.alert(data.msg, {icon: 6});
          $(obj).parent().parent().parent().parent().parent().remove();
        }else{
          layer.alert(data.msg, {icon: 5});
        }
      })
    }
  </script>
</body>

</html>